home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d10 / chrpro3.arc / MCONTRIB.CMD < prev    next >
OS/2 REXX Batch file  |  1991-01-21  |  7KB  |  266 lines

  1. * Program MCONTRIB - Controls all Contributions program functions
  2. Clear
  3. Set talk off
  4. Set deleted on
  5. Set intensity off
  6. ?
  7. ? 'Now loading the MCONTRIB Program'
  8. Select secondary
  9. Use CDIRFILE index CDIRFILE
  10. Store 'January  February March    April    May      June     ' to MONTHS
  11. Store MONTHS+'July     August   SeptemberOctober  November December ' to MONTHS
  12. If $(DATE(),7,2) = '00'
  13.   Set date to 01,01,00
  14. ENDIF
  15.   Store ' ' to curmonthx
  16.   Store ' ' to curyear
  17.   Store ' ' to curmonth
  18.   * Set today's date from current system-date
  19.   Store $(date(),1,2) to curmo
  20.   Store $(date(),7,2) to curmonthx
  21.   Store val(curmo) to nmonth
  22.   Store curmo+curmonthx to indate
  23.   If $(date(),4,1) = '0'
  24.     Store $(DATE(),5,1) to CURMONTHX
  25.   else
  26.     Store $(DATE(),4,2) to CURMONTHX
  27.   endif
  28.   Store trim($(months,NMONTH*9-8,9)) to curmonth
  29.   Store curmonth+' '+curmonthx to curmonthx
  30.   Store ', 19'+$(DATE(),7,2) to CURYEAR
  31. GOTO 1
  32. Store trim($(SPACT,4,27)) to CHNAME
  33. SKIP
  34. Store $(SPACT,21,1) to D
  35. Store curmonthx+curyear to curdate
  36. Release curmonthx,curmonth,indate,nmonth,curmo
  37. GOTO 3
  38. Store $(spact,27,4) to cyearcon
  39. SKIP
  40. Store val($(spact,3,2)) to NN
  41. Store trim($(months,NN*9-8,9)) to CMONTHCO
  42. If $(spact,28,2)='  '
  43.   Store $(spact,3,24) to curdates
  44. else
  45.   Store $(SPACT,3,29)+' ' to curdates
  46. endif
  47. SKIP
  48. If $(spact,3,29)='                            '
  49.   SKIP
  50. else
  51.   If $(spact,28,2)='  '
  52.     Store curdates+$(spact,3,24) to curdates
  53.   else
  54.     Store curdates+$(spact,3,29)+' ' to curdates
  55.   endif
  56.   SKIP
  57.   If $(spact,28,2)='  '
  58.     Store curdates+$(spact,3,24) to curdates
  59.   else
  60.     Store curdates+$(spact,3,29)+' ' to curdates
  61.   endif
  62. endif
  63. GOTO 7
  64. If !($(spact,30,1))='Q'
  65.   Store 15 to wknummax
  66.   GOTO 6
  67.   Store val($(spact,3,2)) to NN
  68.   Store trim($(months,NN*9-8,9)) to cmonthco
  69. else
  70.   Store 6 to wknummax
  71. endif
  72. GOTO 8
  73. Store val($(spact,28,4)) to MAXOFFER
  74. Store maxoffer to OFFERMAX
  75. SKIP
  76. Store F to pageprnt
  77. If !($(SPACT,26,1))='Y'
  78.   Store T to pageprnt
  79. endif
  80. GOTO 12
  81. STORE 'X' TO OCATNAM0
  82. Store '0' to N
  83. Store '  ' to HDR3
  84. Do while OCATNAM&N<>'          ' .and. N<>'4'
  85.   Store str(val(N)+1,1) to N
  86.   Store $(spact,21,10) to OCATNAM&N
  87.   Store HDR3+'  '+OCATNAM&N to HDR3
  88.   SKIP
  89. enddo
  90. If N = '4'
  91.   If OCATNAM4=' '
  92.     STORE $(HDR3,1,37) TO HDR3
  93.   ELSE
  94.     Store '5' to N
  95.   endif
  96. endif
  97. Store '    TOTAL ' to OCATNAM&N
  98. Store HDR3+'  '+OCATNAM&N to HDR3
  99. Store N to OT
  100. GOTO 16
  101. Store ' ' to CSA
  102. If !($(spact,29,1))='Y'
  103.   GOTO 49
  104.   Store trim($(spact,2,38)) to CSA
  105.   GOTO 50
  106.   Store trim(CSA+$(spact,2,38)) to CSA
  107. endif
  108. GOTO 27
  109. If $(spact,3,29)='                             '
  110.   Store F to OFFNOTE
  111. else
  112.   Store T to OFFNOTE
  113. endif
  114. Release validd1,msel,months,level1,nn,ocatnam0,curyear
  115. Store D+':contrib' to MFILE
  116. Use
  117. Select primary
  118. Store T to CONTINU
  119. Do while CONTINU
  120.   Set format to screen
  121.   Erase
  122.   @ 1,1  say chname
  123.   @ 1,62 say curdate
  124.   @ 2,1  say 'DATA DISK = '+D
  125.   @ 3,15 say ' CHURCH CONTRIBUTIONS ENTRY AND REPORTING          '1-/MCONTRIB/'
  126.   @ 6,9  SAY '1)  Perform a new month initialize'
  127.   @ 6,69 SAY '/MCONINIT/'
  128.   @ 7,9 say  '2)  Perform weekly entering of church offerings'
  129.   @ 7,69 SAY '/MCONINPU/'
  130.   @ 8,9 say  '3)  Generate end-of-period office report of all offerings'
  131.   @ 8,69 SAY '/MCONREPT/'
  132.   @ 9,9 say  '    plus create the new next-period file CONTRIBX'
  133.   @ 10,9 say '4)  Create the new next-period file CONTRIBX'
  134.   @ 10,69 SAY '/MCONREPT/'
  135.   @ 11,9 say '5)  Generate individual offering statements'
  136.   @ 11,69 SAY '/MCONSTAT/'
  137.   @ 12,9 say '6)  Direct Display/Editing of the CONTRIB file, PLEDGED'
  138.   @ 12,69 say '/MCONFILE/'
  139.   @ 13,9 say '7)  Contributions Analysis Reports'
  140.   @ 13,69 say '/MCANALYS/'
  141.   @ 14,9 say '8)  Special Funds processing'
  142.   @ 14,69 say '/MCSFUNDS/'
  143.   @ 15,9 say '9)  SET UP'
  144.   @ 15,69 say '/CFNAMESC/'
  145. ?
  146. Accept '         Enter selection ' to OSEL
  147. ?
  148. If !(osel)='DISK='
  149.   Store !($(osel,6,1)) to D
  150.   ? 'Disk now being set to drive',D
  151.   Save to MEMVARSC
  152. else
  153. Store $(osel,1,1) to xx
  154. Do while @(xx,'123456789Qq')=0
  155.   Accept 'Invalid entry.  Please enter again ' to XX
  156.   Store $(xx,1,1) to osel
  157. enddo
  158. If osel='9'
  159.       ?
  160.       ?       'Select:   1) Start a new CONTRIBX file (for a new year)'
  161.       ?       '          2) Printer start-up, special characters'
  162.       Accept  '          3) Edit the Names Directory (CDIRFILE)       ' to XX
  163.       If XX='2'
  164.         Select secondary
  165.         Use CDIRFILE
  166.         GOTO 23
  167.         Store 13 to inchnum
  168.         ? 'Turn the printer on . . .'
  169.         Store $(spact,inchnum,2) to inchar
  170.         Set format to print
  171.         Do while inchar<>' '.and.inchnum<30
  172.           Store val(inchar) to inchval
  173.           @ 0,inchnum say chr(inchval)
  174.           ? 'ASCII ',inchar
  175.           Store inchnum+3 to inchnum
  176.           Store $(spact,inchnum,2) to inchar
  177.         enddo
  178.         Release inchar,inchunm,inchval
  179.         Set format to screen
  180.         Use
  181.         ? 'Printer is now initialized.'
  182.       endif
  183.       If XX='1'
  184.       Store str(MAXOFFER,4) to xx
  185. ? 'This routine deletes any existing CONTRIBX file, then makes another, with'
  186. ? 'all contribution values being zero. The envelope number count is',xx
  187. ? 'as found in the Names Directory file (CDIRFILE).'
  188.       Accept 'Ok? ' to XX
  189.       If !(XX)<>'Y'
  190.         Accept 'No changes made. Press <RETURN>' to xx
  191.       else
  192.       Store d+':CONTRIBX' to MFILE
  193.       If wknummax=6
  194.         USE CONTRIBT
  195.       else
  196.         USE CONTRIBU
  197.       endif
  198.       Copy structure to &MFILE
  199.       Use &MFILE
  200.       Store 0 to recnum
  201.       Store 0 to recc
  202.       Do while recnum<maxoffer
  203.         Store recnum+1 to recnum
  204.         Store recc+1 to recc
  205.         Append blank
  206.         If recc=100
  207.           Store 0 to recc
  208.           ? recnum,'  RECORDS made'
  209.         endif
  210.       enddo
  211.       ? recnum,'  RECORDS MADE'
  212.       Release recc,recnum,xx
  213.       Accept 'CONTRIBX file is complete. Press <retn> ' to XX
  214.       endif
  215.       else
  216.         If XX='2'
  217.           Do CFNAMESC.CMD
  218.         else
  219.           Accept 'Invalid selection. Press <RETURN>' to xx
  220.         endif
  221.       endif
  222. else
  223.   Store D+':CONTRIB' to MFILE
  224.   If .not.file(MFILE)
  225. ? 'CONTRIB file is not present on the data disk. Perform SET UP to create it.'
  226. ?
  227. Accept 'Press <RETURN> to continue' to xx
  228.   else
  229.   Select primary
  230.   Use &MFILE
  231.   Do case
  232.   CASE OSEL = '1'
  233.       Do MCONINIT.CMD
  234.     CASE OSEL = '2'
  235.       Save to MEMVARSC
  236.       Do MCONINPU.CMD
  237.       Restore from MEMVARSC
  238.     CASE OSEL = '3' .or. OSEL = '4'
  239.       Do MCONREPT.CMD
  240.     CASE OSEL = '5'
  241.       Save to MEMVARSC
  242.       Do MCONSTAT.CMD
  243.       Restore from MEMVARSC
  244.       Delete file MEMVARSC.MEM
  245.     CASE OSEL = '6'
  246.       DO MCONFILE.CMD
  247.     CASE OSEL='7'
  248.       Do MCANALYS.CMD
  249.     CASE OSEL='8'
  250.       DO MCSFUNDS.CMD
  251.     CASE !(OSEL) = 'Q'
  252.       RETURN
  253.   ENDCASE
  254.   endif
  255.   endif
  256.   endif
  257.   ENDDO
  258. endif
  259. USE
  260. ENDDO
  261. RETURN
  262.  
  263. xisting CONTRIBX file, then makes another, with'
  264. ? 'all contribution values being zero. The envelope number count is',xx
  265. ? 'as found in the Names Directory file (CDIRFILE).'
  266.       Accept 'Ok? ' t